package com.ihr360.cnb.module.insurance.service;

import com.ihr360.commons.model.type.BenefitCategory;
import com.ihr360.commons.vo.PageData;
import com.ihr360.insurance.entity.request.StaffBenefitRequest;
import com.ihr360.insurance.entity.vo.SingleStaffBenefitVo;
import com.ihr360.insurance.entity.vo.StaffBenefitVo;

import java.util.List;

/**
 * @author Stone.Shi
 * @description
 * @date 2018-06-06 15:32:39.
 */
public interface CompanyBenefitAggregateService {

    /**
     * 获取未关联社保公积金的在职员工数据
     *
     * @param companyId
     * @param userId
     * @param request
     * @param authorityCode
     * @return
     */
    PageData<StaffBenefitVo> getUnrelatedStaffs(String companyId, String userId, StaffBenefitRequest request, String authorityCode);

    /**
     * 获取已关联社保公积金方案的人数
     *
     * @param companyId
     * @param userId
     * @param category
     * @param authorityCode
     * @return
     */
    int getRelatedStaffCount(String companyId, String userId, BenefitCategory category, String authorityCode);

    /**
     * 获取未关联社保公积金方案的在职人数
     *
     * @param companyId
     * @param userId
     * @param category
     * @param authorityCode
     * @return
     */
    int getUnRelatedStaffCount(String companyId, String userId, BenefitCategory category, String authorityCode);

    /**
     * 保存社保公积金数据,category指定主要的保存对象为社保还是公积金
     *
     * @param companyId
     * @param userId
     * @param benefitVos
     * @param category
     * @param authorityCode
     */
    void saveBenefits(String companyId, String userId, List<StaffBenefitVo> benefitVos, BenefitCategory category, String authorityCode);

    /**
     * 仅保存社保或者公积金数据
     *
     * @param companyId
     * @param userId
     * @param singleBenefitVos
     * @param category
     * @param authorityCode
     */
    void saveSingleBenefits(String companyId, String userId, List<SingleStaffBenefitVo> singleBenefitVos, BenefitCategory category, String authorityCode);

    /**
     * 从方案中删除关联的员工：
     * 仅从员工数据中删除社保或者公积金数据
     * 删除时：是将对应员工数据中的方案id置为null
     *
     * @param companyId
     * @param userId
     * @param singleBenefitVos
     * @param category
     * @param authorityCode
     */
    void deleteSingleBenefits(String companyId, String userId, List<SingleStaffBenefitVo> singleBenefitVos, BenefitCategory category, String authorityCode);
}
